package com.tl.commonlibrary.ui.beans;

import java.io.Serializable;

/**
 * Created by JongSung on 18/3/1.
 */

public class ExamSubBean implements Serializable {
    public static final int USER_STATUS_NEW = 0;
    public static final int USER_STATUS_TRAIL = 1;
    public static final int USER_STATUS_PURCHASED = 2;
    public static final int USER_STATUS_FREE = 3;
    /**
     * id : 2
     * title : 2018年人力资源资购买价格初级考试卷2
     * price : 3.00
     * itemNum : 30
     */

    private long id;
    private String title;
    private double price;
    private int itemNum;
    private int userStatus;// 0 未使用 1 试用 2 购买 3 免费试用

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getItemNum() {
        return itemNum;
    }

    public void setItemNum(int itemNum) {
        this.itemNum = itemNum;
    }

    public int getUserStatus() {
        return userStatus;
    }

    public void setUserStatus(int userStatus) {
        this.userStatus = userStatus;
    }

    /**
     * 可以正式使用该试卷
     *
     * @return
     */
    public boolean canStart() {
        return price <= 0 || userStatus == ExamSubBean.USER_STATUS_PURCHASED || userStatus == ExamSubBean.USER_STATUS_FREE;
    }

    public boolean canTry() {
        return userStatus == USER_STATUS_NEW || userStatus == USER_STATUS_TRAIL;
    }
}
